home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / BGDeco.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  957 b   |  45 lines

  1. class classes.fx.BGDeco
  2. {
  3.    var id;
  4.    var showing;
  5.    var speed;
  6.    var clip;
  7.    var yMov;
  8.    var h;
  9.    var Name = "bgDeco";
  10.    function BGDeco()
  11.    {
  12.    }
  13.    function showBG(pid, pspeed)
  14.    {
  15.       this.id = pid;
  16.       if(!this.showing)
  17.       {
  18.          this.speed = pspeed;
  19.          this.clip = _root.attachMovie("bgDeco","bgDecoClip",1);
  20.          this.clip.cacheAsBitmap = true;
  21.          this.clip._y = 603;
  22.          this.yMov = -1 * this.speed;
  23.          this.clip.gotoAndStop(this.id);
  24.          this.h = this.clip._height;
  25.          this.showing = true;
  26.       }
  27.    }
  28.    function main()
  29.    {
  30.       if(this.showing)
  31.       {
  32.          if(this.clip._y + this.h < -5)
  33.          {
  34.             this.clip.removeMovieClip();
  35.             this.showing = false;
  36.             if(this.id == "3E")
  37.             {
  38.                this.showBG("3E",0.5);
  39.             }
  40.          }
  41.          this.clip._y += this.yMov;
  42.       }
  43.    }
  44. }
  45.